<template>
  <div>
    <Select :selsetList="selsetList" :changeData="changeData" @changeDataFn="lischangeDataFn"></Select>
    {{password}}

    <div @click="changeDataFn">改变状态 </div> 

    <Hw></Hw>
  </div>
</template>
<script>
import Select from "./common/lyh-select"
import Hw from "./HelloWorld1"
import {mapGetters,mapActions} from 'vuex'
  export default {
  data() {
    return {
      selsetList:[
        {
          name:'大象',
          code:1
        },
        {
          name:'小鸟',
          code:2
        },
        {
          name:'海豚',
          code:3
        }
      ],
      changeData: {
           name:'大象',
           code:1
        }
      
    };
  },
 computed:mapGetters([
		'password',

	]),
  methods: {
    lischangeDataFn(val){
      this.changeData = val;
    },
    // 改变状态
    changeDataFn(){
      	this.$store.commit('ADD');

    },
    ...mapActions([
      'increment',
      'decrement'
    ])
  },
  
  mounted(){
    console.log(this.$store)
  },
  watch:{},
  beforeRouteLeave(to, from, next) {
  next();
  },
  components: {
    Select,
    Hw
  }
  }
</script>
<style lang="less" scoped>
</style>